import os


class Base:
    def __init__(self):
        self._name = None
        self._base_path = None

    @property
    def name(self):
        if self._name is None:
            self._name = type(self).__name__
        return self._name

    @property
    def base_path(self):
        if self._base_path is None:
            path, _ = os.path.split(__file__)
            while '__init__.py' in os.listdir(path):
                path, _ = os.path.split(path)
            self._base_path = path
        return self._base_path


